package com.itlong.cloud.commons.service;

import com.itlong.cloud.POJO.DTO.app.AppUserAccountBalanceDTO;
import com.itlong.cloud.POJO.PO.AppUserAccountBalancePO;

import java.math.BigDecimal;
import java.util.Map;

/**
 * <desc>
 *  账户余额及扣费暴露接口
 * </desc>
 *
 * @createDate 2018/4/23
 */
public interface IAccountBalanceService {


    /**
     * <desc>
     *      根据userId查询余额
     * <desc/>
     * @param  userId   带查询的userId
     * @return 余额
     * @author Juguang.S
     * @createDate 2018/4/23
     */
    BigDecimal getBalanceByUserId(String userId);

    /**
     * <desc>
     *      根据userId查询对象
     * <desc/>
     * @param  userId   带查询的userId
     * @return 余额
     * @author Juguang.S
     * @createDate 2018/4/23
     */
    AppUserAccountBalancePO getUser(String userId);

    /**
     * <desc>
     *      扣费
     * <desc/>
     * @param
     * @return
     * @author Juguang.S
     * @createDate 2018/4/23
     */
    Map<String,Object> updateBalance(AppUserAccountBalanceDTO appUserAccountBalanceDTO);

    /**
     * <desc>
     *      检查当前订单状态是否为支付成功
     * </desc>
     *
     * @param billsId 订单号
     * @return
     * @author Jiaqi.X
     * @createDate 2018/04/27
     */
    Boolean checkTradeSuccess(String billsId, String userId, String tradeId);

    /**
     * <desc>
     *      更新余额流水来源id
     * </desc>
     *
     * @param recordId 订单id
     * @param sourceId  来源id
     * @return
     * @author Jiaqi.X
     * @createDate 2018/04/28
     */
    Integer updateTradeSourceId(String recordId, String sourceId);

    /**
     * <desc>
     *      根据账单ID查询月卡订单的截止时间
     * </desc>
     *
     * @param billId 订单id
     * @return
     * @author Juguang.S
     * @createDate 2018/11/12
     */
    String getMonthCardTime(String billId);
}